package com.rjkj.medicalwaste.viewmodels

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import androidx.paging.PagingData
import androidx.paging.cachedIn
import com.rjkj.medicalwaste.base.BaseViewModel
import com.rjkj.medicalwaste.bean.TestBean
import com.rjkj.medicalwaste.repository.BoxListRepository
import com.rjkj.medicalwaste.repository.Repository
import kotlinx.coroutines.flow.Flow

class BoxListViewModel:BaseViewModel() {
    val pageNum = MutableLiveData(1)
    val scanFixBoxCode = MutableLiveData<String>()

    var openScanFixBoxDialog = false
    fun getPagingData(): Flow<PagingData<TestBean>> {
        return BoxListRepository.getPagingData(pageNum.value!!)
    }
//    fun getLastPagingData(): Flow<PagingData<TestBean>> {
//        int--
//        return Repository.getPagingData(pageNum)
//    }
//    fun getNextPagingData(): Flow<PagingData<TestBean>> {
//        int++
//        return Repository.getPagingData(pageNum)
//    }
}